/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.etecmatao.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "dados_usuarios")
@NamedQueries({
    @NamedQuery(name = "DadosUsuarios.findAll", query = "SELECT d FROM DadosUsuarios d"),
    @NamedQuery(name = "DadosUsuarios.findByEmail", query = "SELECT d FROM DadosUsuarios d WHERE d.email = :email"),
    @NamedQuery(name = "DadosUsuarios.findByNome", query = "SELECT d FROM DadosUsuarios d WHERE d.nome = :nome"),
    @NamedQuery(name = "DadosUsuarios.findByStatus", query = "SELECT d FROM DadosUsuarios d WHERE d.status = :status")})
public class DadosUsuarios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @Column(name = "nome")
    private String nome;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @JoinColumn(name = "email", referencedColumnName = "email", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Login login;

    public DadosUsuarios() {
    }

    public DadosUsuarios(String email) {
        this.email = email;
    }

    public DadosUsuarios(String email, String nome, String status) {
        this.email = email;
        this.nome = nome;
        this.status = status;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Login getLogin() {
        return login;
    }

    public void setLogin(Login login) {
        this.login = login;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (email != null ? email.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DadosUsuarios)) {
            return false;
        }
        DadosUsuarios other = (DadosUsuarios) object;
        if ((this.email == null && other.email != null) || (this.email != null && !this.email.equals(other.email))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "admin.model.DadosUsuarios[email=" + email + "]";
    }

}
